/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* 容器布局 */
.container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
  width: 280px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.logo {
  padding: 30px 25px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.logo h1 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: white;
}

.logo p {
  font-size: 14px;
  opacity: 0.8;
  color: rgba(255,255,255,0.8);
}

.nav-menu {
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 15px 25px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background-color: rgba(255,255,255,0.1);
  color: white;
  border-left-color: rgba(255,255,255,0.3);
}

.nav-item.active {
  background-color: rgba(255,255,255,0.15);
  color: white;
  border-left-color: white;
  font-weight: 500;
}

.nav-item .icon {
  margin-right: 12px;
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* 主内容区样式 */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 30px;
  background-color: #f8f9fa;
  min-height: 100vh;
}

.content-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}

.content-section.active {
  display: block;
}

.section-header {
  padding: 30px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #e9ecef;
}

.section-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}

.section-header p {
  color: #6c757d;
  font-size: 16px;
}

/* 设置组样式 */
.settings-group {
  padding: 0;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.2s ease;
}

.setting-item:hover {
  background-color: #f8f9fa;
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-info h3 {
  font-size: 16px;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 4px;
}

.setting-info p {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.4;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 开关样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #667eea;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* 表单控件样式 */
.form-input, .form-select, .form-textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  background-color: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input {
  width: 120px;
}

.form-select {
  width: 100px;
}

.form-textarea {
  width: 100%;
  resize: vertical;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 按钮样式 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-outline {
  background: white;
  color: #667eea;
  border: 1px solid #667eea;
}

.btn-outline:hover {
  background: #667eea;
  color: white;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* 域名白名单样式 */
.whitelist-manager {
  padding: 30px;
}

.add-domain {
  margin-bottom: 30px;
}

.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.input-group .form-input {
  flex: 1;
  width: auto;
}

.domain-examples {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.domain-examples p {
  color: #6c757d;
  font-size: 14px;
  margin: 0;
}

.example-tag {
  background: #e9ecef;
  color: #495057;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.domain-list {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}

.list-header h3 {
  font-size: 18px;
  font-weight: 500;
  color: #2c3e50;
  margin: 0;
}

.list-actions {
  display: flex;
  gap: 10px;
}

.domain-list-container {
  max-height: 400px;
  overflow-y: auto;
}

.domain-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.domain-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.domain-name {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  color: #2c3e50;
}

.remove-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s ease;
}

.remove-btn:hover {
  background: #c82333;
}

/* Mock管理样式 */
.mock-manager {
  padding: 30px;
}

.mock-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.filter-controls {
  display: flex;
  gap: 10px;
}

.filter-controls .form-input {
  width: 200px;
}

.filter-controls .form-select {
  width: 120px;
}

.mock-list {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
}

.mock-list-container {
  max-height: 500px;
  overflow-y: auto;
}

.mock-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.mock-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.1);
}

.mock-info {
  flex: 1;
}

.mock-url {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 6px;
}

.mock-method {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 6px;
}

.mock-description {
  color: #6c757d;
  font-size: 13px;
}

.mock-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mock-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-toggle input[type="checkbox"] {
  transform: scale(1.2);
}

.mock-buttons {
  display: flex;
  gap: 8px;
}

.edit-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s ease;
}

.edit-btn:hover {
  background: #218838;
}

.delete-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s ease;
}

.delete-btn:hover {
  background: #c82333;
}

/* 请求历史样式 */
.request-manager {
  padding: 30px;
}

.request-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.request-filters {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.filter-row {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-row .form-input {
  width: 200px;
}

.filter-row .form-select {
  width: 150px;
}

.request-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.1);
}

.stat-card h4 {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-card span {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
}

.request-list {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
}

.count {
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}

/* 存储记录样式 */
.storage-manager {
  padding: 30px;
}

.storage-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.storage-list {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
}

.storage-stats {
  color: #6c757d;
  font-size: 14px;
}

.storage-items-container {
  max-height: 600px;
  overflow-y: auto;
}

.storage-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.storage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.storage-header h4 {
  font-size: 16px;
  font-weight: 500;
  color: #2c3e50;
  margin: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.storage-actions {
  display: flex;
  gap: 8px;
}

.storage-content {
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
  background: #f8f9fa;
}

.storage-content pre {
  margin: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #2c3e50;
}

/* JSON语法高亮 */
.json-key {
  color: #d73a49;
  font-weight: 500;
}

.json-string {
  color: #032f62;
}

.json-number {
  color: #005cc5;
}

.json-boolean {
  color: #e36209;
  font-weight: 500;
}

.json-null {
  color: #6f42c1;
  font-weight: 500;
}

/* 导入导出样式 */
.import-export-manager {
  padding: 30px;
}

.export-section, .import-section {
  background: white;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 25px;
}

.export-section h3, .import-section h3 {
  font-size: 18px;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 10px;
}

.export-section p, .import-section p {
  color: #6c757d;
  margin-bottom: 20px;
}

.export-options {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
  transform: scale(1.1);
}

.import-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  transition: all 0.2s ease;
}

.import-area:hover {
  border-color: #667eea;
  background: #f8f9fa;
}

.file-drop-zone {
  cursor: pointer;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drop-icon {
  font-size: 48px;
  opacity: 0.5;
}

.file-info {
  color: #6c757d;
  font-size: 12px;
}

/* 关于页面样式 */
.about-content {
  padding: 30px;
}

.plugin-info {
  background: white;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 25px;
  text-align: center;
}

.plugin-info h3 {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}

.version {
  color: #667eea;
  font-weight: 500;
  margin-bottom: 15px;
}

.description {
  color: #6c757d;
  line-height: 1.6;
}

.features, .usage-guide, .support {
  background: white;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-bottom: 25px;
}

.features h4, .usage-guide h4, .support h4 {
  font-size: 18px;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 15px;
}

.features ul {
  list-style: none;
  padding: 0;
}

.features li {
  padding: 8px 0;
  color: #2c3e50;
  font-size: 14px;
}

.usage-guide ol {
  padding-left: 20px;
}

.usage-guide li {
  padding: 5px 0;
  color: #2c3e50;
  line-height: 1.5;
}

.support-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.support-link {
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.support-link:hover {
  color: #764ba2;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

.modal-content.large {
  max-width: 800px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 500;
  color: #2c3e50;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #f8f9fa;
  color: #2c3e50;
}

.modal-body {
  padding: 30px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 30px;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
}

/* 表单样式 */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  margin-bottom: 20px;
}

.form-group.half {
  flex: 0 0 calc(50% - 10px);
}

.form-group label {
  display: block;
  font-weight: 500;
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group small {
  display: block;
  color: #6c757d;
  font-size: 12px;
  margin-top: 5px;
}

.json-tools {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .sidebar {
    width: 250px;
  }
  
  .main-content {
    margin-left: 250px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .container {
    flex-direction: column;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .form-group.half {
    flex: 1;
  }
  
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-row .form-input,
  .filter-row .form-select {
    width: 100%;
  }
  
  .request-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .export-options {
    flex-direction: column;
  }
  
  .support-links {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 15px;
  }
  
  .section-header {
    padding: 20px;
  }
  
  .section-header h2 {
    font-size: 24px;
  }
  
  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .mock-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .domain-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .request-stats {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 加载状态 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #6c757d;
}

.loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #e9ecef;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #2c3e50;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.5;
}

/* 成功/错误状态 */
.success {
  color: #28a745;
}

.error {
  color: #dc3545;
}

.warning {
  color: #ffc107;
}

.info {
  color: #17a2b8;
}

/* 工具提示 */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}